home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / Sample Code / DTS_SCSI Code (In Development) / DTS_SCSI_Driver.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-15  |  3.1 KB  |  100 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        DTS_SCSI_Driver.h
  3.     
  4.     
  5.     
  6.     
  7.     
  8.     Unfortunately, no matter how long awaited, it's still not done.  In fact, this
  9. isn't even a release- this is just an image of the code taken in the middle of
  10. development.
  11.  
  12. THIS CODE DOES NOT WORK AS A WHOLE.  MUCH OF IT IS BUGGY AND / OR INCOMPLETE.
  13. YOU WOULD HAVE TO BE ABSOLUTELY INSANE TO USE ANY OF THIS CODE IN YOUR
  14. PROJECT WITHOUT EXTENSIVE THOUGHT, DEBUGGING AND TESTING.
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.     Contains:    SCSI Sample Driver global types, constants, and function prototypes
  22.  
  23.     Written by:    Craig Prouse
  24.  
  25.     Copyright:    © 1991 by Apple Computer, Inc., all rights reserved.
  26.  
  27.     Change History (most recent first):
  28.          <6>    04/24/91    tmd        Enum'd csCodes, created driverIconCode
  29.          <5>    11/25/91    chp        remove some unnecessary prototypes, reflect changes to the API,
  30.                                     eliminate an unnecessary drive variable, and general cleanup
  31.          <4>    10/16/91    chp        complete preliminary definition of the driver variables
  32.          <3>    10/15/91    chp        add some driver variables and remove some unnecessary typedefs
  33.          <2>    10/15/91    chp        update header contents
  34.          <1>    10/15/91    chp        first checked in
  35.  
  36.     To Do:
  37. */
  38.  
  39. #ifndef __DTS_SCSI__
  40. #define __DTS_SCSI__
  41.  
  42. #ifndef __FILES__
  43. #include <Files.h>
  44. #endif
  45.  
  46. #ifndef __DEVICES__
  47. #include <Devices.h>
  48. #endif
  49.  
  50. // Our driver's name as a Pascal string. This has to match the one in DTS_SCSI_Driver.a!
  51. #define kDriverName "\P.DTS_SCSI"
  52.  
  53. // The current version number of our driver. This has to match the one in DTS_SCSI_Driver.a!
  54. #define kCurrentDriverVersion 1
  55.  
  56. // The bit in the driver header flags word that controls whether
  57. // our driver gets accRun calls. We twiddle it to get an extra chance
  58. // to ensure that our volume gets mounted at boot time, even if it's not
  59. // the boot volume.
  60. #define dNeedTime (0x20) /* bit 5 of the driver's flags word */
  61.  
  62. // The drive queue flag value to mark our drive as non-ejectable
  63. #define noEjectFlag 0x08
  64.  
  65. // csCodes for Control routines
  66. typedef enum {
  67.     killCode = 1,            // KillIO translates into this
  68.     verifyCode = 5,            // We don't support it, but we need to return noErr
  69.     formatCode = 6,            // Finder-level "Erase Disk…" low-level format call (unsupported)
  70.     ejectCode = 7,
  71.     mediaIconCode = 21,     // Finder's "give me the disk icon" call *** No support for ID=20, required for Finder 1.1
  72.     deviceIconCode = 23        // "Give me the physical icon" call (DIBadMount)
  73. } EControlCode;
  74.  
  75. //
  76. // A complete drive queue element, including the "pre-element" flags.  We insert
  77. // this to make alignment necessary for the char field.
  78. //
  79.  
  80. typedef struct TXDrvQEl {
  81.     unsigned char    flags[4];        /* The drive queue element's flags */
  82.     DrvQEl            elem;            /* The drive queue element itself */
  83. } TXDrvQEl;
  84.  
  85. /*
  86.  * The state of one drive, including its drive queue element.
  87.  * (we need one of these for each partition/volume/drive serviced)
  88.  */
  89. typedef struct TDriveVars {
  90.     short            driveID;            /* SCSI bus ID of this drive */
  91.     long            partitionOffset;    /* Block offset to the start of this volume's partition */
  92.     TXDrvQEl        driveQElem;            /* The complete drive queue element */
  93.     unsigned long    driveBlockSize;        /* size in bytes of each block on the drive */
  94.     Boolean            tickleFlag;
  95.     Boolean            blindOK;
  96. } TDriveVars;
  97.  
  98.  
  99. #endif
  100.